package com.zyylr.classroomreservationsystem.activity;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.danielstone.materialaboutlibrary.MaterialAboutActivity;
import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem;
import com.danielstone.materialaboutlibrary.model.MaterialAboutCard;
import com.danielstone.materialaboutlibrary.model.MaterialAboutList;
import com.zyylr.classroomreservationsystem.R;

/**
 * "关于软件"界面，该界面不使用xml文件
 */
public class AboutActivity extends MaterialAboutActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @NonNull
    @Override
    protected MaterialAboutList getMaterialAboutList(@NonNull Context context) {
        MaterialAboutCard softwareInfoCard = new MaterialAboutCard.Builder()
                .title(R.string.app_name)
                .addItem(
                        new MaterialAboutActionItem.Builder()
                                .text("版本")
                                .subText("1.0.0")
                                .icon(R.drawable.version)
                                .build()
                )
                .build();

        MaterialAboutCard card = new MaterialAboutCard.Builder()
                .title("作者")
                .addItem(
                        new MaterialAboutActionItem.Builder()
                                .text("赵永远")
                                .subText("1610411010")
                                .icon(R.drawable.author)
                                .build()
                )
                .addItem(
                        new MaterialAboutActionItem.Builder()
                                .text("梁锐")
                                .subText("1610411001")
                                .icon(R.drawable.author)
                                .build()
                )
                .build();

        return new MaterialAboutList.Builder()
                .addCard(softwareInfoCard)
                .addCard(card)
                .build();
    }

    @Nullable
    @Override
    protected CharSequence getActivityTitle() {
        return null;
    }
}
